package cn.cjp.day03;

//定义子类
public class Teacher extends Employee{

    int num=20;

    public static void main(String[] args) {
    Teacher teacher = new Teacher();
    //调用父类方法
    teacher.method1();
    }

    public void nummethodZi(){

        System.out.println(num);
    }

    //返回值
    @Override
    public String methid2(){
        System.out.println("这是子的第二个方法");
        return null;
    }

    @Override                   //可加可不加  加了就检测
    public void method1() {
        int num = 30;
        //区分
        System.out.println(super.num);   //父类变量
        System.out.println(num);         //局部变量
        System.out.println(this.num);       //本类变量
    }
}
